﻿using Microsoft.AspNetCore.Authorization;
using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.DependencyInjection;
using System;
using Volo.Abp.AspNetCore.Mvc;

namespace Xms.Abp.AspNetCore.Mvc;

//[Authorize]
[ApiExplorerSettings(IgnoreApi = true)]
public abstract class XmsPageController : AbpController
{
    public XmsPageController()
    {

    }
    protected TService LazyInject<TService>()
    {
        return LazyServiceProvider.LazyGetRequiredService<TService>();
    }

    [Obsolete("Use LazyInject method.")]
    protected TService Inject<TService>()
    {
        return ServiceProvider.GetRequiredService<TService>();
    }
}
public abstract class XmsPageController<TService> : XmsPageController
{
    public XmsPageController()
    {

    }
    protected TService CurrentService => LazyInject<TService>();
}

